KFbxLayer Class Reference

#include <kfbxlayer.h>

List of all members.


Detailed Description

KFbxLayer class provides a base for the layering mechanism.

A layer can contain one or more of the following layer elements:

A typical layer for a Mesh contains Normals, UVs and Materials. A typical layer for NURBS contains only Materials. If you apply a texture to a Mesh, a typical layer contains the Textures as well as the UVs. In the case of the NURBS, the NURBS' parameterization is used for the UVs; no UVs should be specified. The texture mapping is defined completely within the layer; there is no cross-layer management.

In most cases, you only need a single layer to describe a geometry. Many applications only support what is defined on the first layer. Take this into account when you fill the layer. For example, it is legal to define the Layer 0 with the Textures and UVs and then define the model's Normals on layer 1. However if you construct a file this way, it may not be imported correctly in other applications. Store the Normals in Layer 0 to avoid problems.

You can achieve texture layering when you define more than one layer that contains Textures and UV elements. For example, a Mesh may have only Textures and corresponding UV elements on Layer 0 to create the primary effect, and then another set of Textures and UVs on Layer 1. The way of the texture blending is defined in the Texture layer element.

Normally, you can access layer from KFbxLayerContainer like KFbxGeometry. For example, KFbxLayer *lLayer0 = lGeometry->GetLayer(0);

See also:
KFbxLayerElement

Definition at line 2301 of file kfbxlayer.h.


Layer Element Management

KFbxLayerElementNormal GetNormals ()
  Returns this layer's Normals description .
KFbxLayerElementNormal const *  GetNormals () const
  Returns this layer's Normals description .
KFbxLayerElementTangent GetTangents ()
  Returns this layer's Tangents description.
KFbxLayerElementTangent const *  GetTangents () const
  Returns this layer's Tangents description.
KFbxLayerElementBinormal GetBinormals ()
  Returns this layer's Binormals description.
KFbxLayerElementBinormal const *  GetBinormals () const
  Returns this layer's Binormals description.
KFbxLayerElementMaterial GetMaterials ()
  Returns this layer's Materials description.
KFbxLayerElementMaterial const *  GetMaterials () const
  Returns this layer's Materials description.
KFbxLayerElementPolygonGroup GetPolygonGroups ()
  Returns this layer's Polygon Groups description.
KFbxLayerElementPolygonGroup
const * 
GetPolygonGroups () const
  Returns this layer's Polygon Groups description.
KFbxLayerElementUV GetUVs (KFbxLayerElement::ELayerElementType pTypeIdentifier=KFbxLayerElement::eDIFFUSE_TEXTURES)
  Returns this layer's UV description.
KFbxLayerElementUV const *  GetUVs (KFbxLayerElement::ELayerElementType pTypeIdentifier=KFbxLayerElement::eDIFFUSE_TEXTURES) const
  Returns this layer's UV description.
int  GetUVSetCount () const
  Returns the number of different UV sets in this layer.
KArrayTemplate
< KFbxLayerElement::ELayerElementType
GetUVSetChannels () const
  Returns an array that describes which UV sets are in this layer.
KArrayTemplate
< KFbxLayerElementUV const * > 
GetUVSets () const
  Returns an array of UV sets in this layer.
KFbxLayerElementVertexColor GetVertexColors ()
  Returns this layer's Vertex Colors description.
KFbxLayerElementVertexColor const *  GetVertexColors () const
  Returns this layer's Vertex Colors description.
KFbxLayerElementSmoothing GetSmoothing ()
  Returns this layer's Smoothing description.
KFbxLayerElementSmoothing const *  GetSmoothing () const
  Returns this layer's Smoothing description.
KFbxLayerElementCrease GetVertexCrease ()
  Returns this layer's vertex crease description.
KFbxLayerElementCrease const *  GetVertexCrease () const
  Returns this layer's vertex crease description.
KFbxLayerElementCrease GetEdgeCrease ()
  Returns this layer's edge crease description.
KFbxLayerElementCrease const *  GetEdgeCrease () const
  Returns this layer's edge crease description.
KFbxLayerElementHole GetHole ()
  Returns this layer's Hole description.
KFbxLayerElementHole const *  GetHole () const
  Returns this layer's Hole description.
KFbxLayerElementUserData GetUserData ()
  Returns this layer's User Data.
KFbxLayerElementUserData const *  GetUserData () const
  Returns this layer's User Data.
KFbxLayerElementVisibility GetVisibility ()
  Returns this layer's visibility.
KFbxLayerElementVisibility const *  GetVisibility () const
  Returns this layer's visibility.
KFbxLayerElementTexture GetTextures (KFbxLayerElement::ELayerElementType pType)
  Returns this layer's Textures description.
KFbxLayerElementTexture const *  GetTextures (KFbxLayerElement::ELayerElementType pType) const
  Returns this layer's Textures description.
void  SetTextures (KFbxLayerElement::ELayerElementType pType, KFbxLayerElementTexture *pTextures)
  Sets this layer's Textures description.
KFbxLayerElement GetLayerElementOfType (KFbxLayerElement::ELayerElementType pType, bool pIsUV=false)
  Returns the specified type of layer element description for this layer.
KFbxLayerElement const *  GetLayerElementOfType (KFbxLayerElement::ELayerElementType pType, bool pIsUV=false) const
  Returns the specified type of layer element description for this layer.
void  SetNormals (KFbxLayerElementNormal *pNormals)
  Sets this layer's Normals description.
void  SetBinormals (KFbxLayerElementBinormal *pBinormals)
  Sets this layer's Binormals description.
void  SetTangents (KFbxLayerElementTangent *pTangents)
  Sets this layer's Tangents description.
void  SetMaterials (KFbxLayerElementMaterial *pMaterials)
  Sets this layer's Materials description.
void  SetPolygonGroups (KFbxLayerElementPolygonGroup *pPolygonGroups)
  Sets this layer's Polygon Groups description.
void  SetUVs (KFbxLayerElementUV *pUVs, KFbxLayerElement::ELayerElementType pTypeIdentifier=KFbxLayerElement::eDIFFUSE_TEXTURES)
  Sets this layer's UVs description.
void  SetVertexColors (KFbxLayerElementVertexColor *pVertexColors)
  Sets this layer's Vertex Colors description.
void  SetSmoothing (KFbxLayerElementSmoothing *pSmoothing)
  Sets this layer's Smoothing description.
void  SetVertexCrease (KFbxLayerElementCrease *pCrease)
  Sets this layer's Vertex Crease description.
void  SetEdgeCrease (KFbxLayerElementCrease *pCrease)
  Sets this layer's Edge Crease description.
void  SetHole (KFbxLayerElementHole *pHole)
  Sets this layer's Hole description.
void  SetUserData (KFbxLayerElementUserData *pUserData)
  Sets this layer's User Data.
void  SetVisibility (KFbxLayerElementVisibility *pVisibility)
  Sets this layer's the visibility.
KFbxLayerElement CreateLayerElementOfType (KFbxLayerElement::ELayerElementType pType, bool pIsUV=false)
  Creates the specified type of layer element description for this layer.
void  Clone (KFbxLayer const &pSrcLayer, KFbxSdkManager *pSdkManager)
  Clone function.

Member Function Documentation

KFbxLayerElementNormal* GetNormals (  ) 

Returns this layer's Normals description .

Returns:
A pointer to the Normals layer element, or NULL if no Normals layer element is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Normals defined.

KFbxLayerElementNormal const* GetNormals (  )  const

Returns this layer's Normals description .

Returns:
A pointer to the Normals layer element, or NULL if no Normals layer element is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Normals defined.

KFbxLayerElementTangent* GetTangents (  ) 

Returns this layer's Tangents description.

Returns:
A pointer to the Tangents layer element, or NULL if no Tangents layer element is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Tangents defined.

KFbxLayerElementTangent const* GetTangents (  )  const

Returns this layer's Tangents description.

Returns:
A pointer to the Tangents layer element, or NULL if no Tangents layer element is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Tangents defined.

KFbxLayerElementBinormal* GetBinormals (  ) 

Returns this layer's Binormals description.

Returns:
A pointer to the Binormals layer element, or NULL if no Binormals layer element is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Binormals defined.

KFbxLayerElementBinormal const* GetBinormals (  )  const

Returns this layer's Binormals description.

Returns:
A pointer to the Binormals layer element, or NULL if no Binormals layer element is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Binormals defined.

KFbxLayerElementMaterial* GetMaterials (  ) 

Returns this layer's Materials description.

Returns:
A pointer to the Materials layer element, or NULL if no Materials layer element is defined in this layer.

KFbxLayerElementMaterial const* GetMaterials (  )  const

Returns this layer's Materials description.

Returns:
A pointer to the Materials layer element, or NULL if no Materials layer element is defined in this layer.

KFbxLayerElementPolygonGroup* GetPolygonGroups (  ) 

Returns this layer's Polygon Groups description.

Returns:
A pointer to the Polygon Groups layer element, or NULL if no Polygon Groups layer element is defined in this layer.

KFbxLayerElementPolygonGroup const* GetPolygonGroups (  )  const

Returns this layer's Polygon Groups description.

Returns:
A pointer to the Polygon Groups layer element, or NULL if no Polygon Groups layer element is defined in this layer.

KFbxLayerElementUV* GetUVs ( KFbxLayerElement::ELayerElementType  pTypeIdentifier = KFbxLayerElement::eDIFFUSE_TEXTURES  ) 

Returns this layer's UV description.

Parameters:
pTypeIdentifier  Layer element type identifier, should be a texture type identifier.
Returns:
A pointer to the UVs layer element, or NULL if no UV is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have UVs defined. The NURBS/Patch parameterization is used as UV parameters to map a texture.

KFbxLayerElementUV const* GetUVs ( KFbxLayerElement::ELayerElementType  pTypeIdentifier = KFbxLayerElement::eDIFFUSE_TEXTURES  )  const

Returns this layer's UV description.

Parameters:
pTypeIdentifier  Layer element type identifier, should be a texture type identifier.
Returns:
A pointer to the UVs layer element, or NULL if no UV is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have UVs defined. The NURBS/Patch parameterization is used as UV parameters to map a texture.

int GetUVSetCount (  )  const

Returns the number of different UV sets in this layer.

KArrayTemplate<KFbxLayerElement::ELayerElementType> GetUVSetChannels (  )  const

Returns an array that describes which UV sets are in this layer.

KArrayTemplate<KFbxLayerElementUV const*> GetUVSets (  )  const

Returns an array of UV sets in this layer.

KFbxLayerElementVertexColor* GetVertexColors (  ) 

Returns this layer's Vertex Colors description.

Returns:
A pointer to the Vertex Colors layer element, or NULL if no Vertex Color layer element is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Vertex Colors defined, since no vertex exists.

KFbxLayerElementVertexColor const* GetVertexColors (  )  const

Returns this layer's Vertex Colors description.

Returns:
A pointer to the Vertex Colors layer element, or NULL if no Vertex Color layer element is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Vertex Colors defined, since no vertex exists.

KFbxLayerElementSmoothing* GetSmoothing (  ) 

Returns this layer's Smoothing description.

Returns:
A pointer to the Smoothing layer element, or NULL if no Smoothing layer element is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Smoothing defined.

KFbxLayerElementSmoothing const* GetSmoothing (  )  const

Returns this layer's Smoothing description.

Returns:
A pointer to the Smoothing layer element, or NULL if no Smoothing layer element is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Smoothing defined.

KFbxLayerElementCrease* GetVertexCrease (  ) 

Returns this layer's vertex crease description.

Returns:
A pointer to the Crease layer element, or NULL if no Crease layer element is defined in this layer.
Remarks:
Crease info should only be defined when the geometry is KFbxSubdiv.

KFbxLayerElementCrease const* GetVertexCrease (  )  const

Returns this layer's vertex crease description.

Returns:
A pointer to the Crease layer element, or NULL if no Crease layer element is defined in this layer.
Remarks:
Crease info should only be defined when the geometry is KFbxSubdiv.

KFbxLayerElementCrease* GetEdgeCrease (  ) 

Returns this layer's edge crease description.

Returns:
A pointer to the Crease layer element, or NULL if no Crease layer element is defined in this layer.
Remarks:
Crease info should only be defined when the geometry is KFbxSubdiv.

KFbxLayerElementCrease const* GetEdgeCrease (  )  const

Returns this layer's edge crease description.

Returns:
A pointer to the Crease layer element, or NULL if no Crease layer element is defined in this layer.
Remarks:
Crease info should only be defined when the geometry is KFbxSubdiv.

KFbxLayerElementHole* GetHole (  ) 

Returns this layer's Hole description.

Returns:
A pointer to the Hole layer element, or NULL if no Hole layer element is defined in this layer.
Remarks:
Hole info should only be defined when the geometry is KFbxMesh.

KFbxLayerElementHole const* GetHole (  )  const

Returns this layer's Hole description.

Returns:
A pointer to the Hole layer element, or NULL if no Hole layer element is defined in this layer.
Remarks:
Hole info should only be defined when the geometry is KFbxMesh.

KFbxLayerElementUserData* GetUserData (  ) 

Returns this layer's User Data.

Returns:
A pointer to the User Data layer element, or NULL if no User Data layer element is defined in this layer.

KFbxLayerElementUserData const* GetUserData (  )  const

Returns this layer's User Data.

Returns:
A pointer to the User Data layer element, or NULL if no User Data layer element is defined in this layer.

KFbxLayerElementVisibility* GetVisibility (  ) 

Returns this layer's visibility.

Returns:
A pointer to the visibility layer element, or NULL if no visibility layer element is defined in this layer.

KFbxLayerElementVisibility const* GetVisibility (  )  const

Returns this layer's visibility.

Returns:
A pointer to the visibility layer element, or NULL if no visibility layer element is defined in this layer.

Returns this layer's Textures description.

Parameters:
pType  Layer element type, should be a texture type identifier.
Returns:
A pointer to the Textures layer element, or NULL if no Textures layer element is defined in this layer.

KFbxLayerElementTexture const* GetTextures ( KFbxLayerElement::ELayerElementType  pType  )  const

Returns this layer's Textures description.

Parameters:
pType  Layer element type, should be a texture type identifier.
Returns:
A pointer to the Textures layer element, or NULL if no Textures layer element is defined in this layer.

void SetTextures ( KFbxLayerElement::ELayerElementType  pType,
KFbxLayerElementTexture pTextures  
)

Sets this layer's Textures description.

Parameters:
pType  Texture type identifier.
pTextures  A pointer to the Textures layer element, or NULL to remove the Textures definition.

KFbxLayerElement* GetLayerElementOfType ( KFbxLayerElement::ELayerElementType  pType,
bool  pIsUV = false  
)

Returns the specified type of layer element description for this layer.

Parameters:
pType  The required Layer element type.
pIsUV  If true, requests the UV layer element that corresponds with the specified texture type.
Returns:
A pointer to the requested layer element, or NULL if the layer element is not defined in this layer.

KFbxLayerElement const* GetLayerElementOfType ( KFbxLayerElement::ELayerElementType  pType,
bool  pIsUV = false  
) const

Returns the specified type of layer element description for this layer.

Parameters:
pType  The required Layer element type.
pIsUV  If true, requests the UV layer element that corresponds with the specified texture type.
Returns:
A pointer to the requested layer element, or NULL if the layer element is not defined in this layer.

void SetNormals ( KFbxLayerElementNormal pNormals  ) 

Sets this layer's Normals description.

Parameters:
pNormals  A pointer to the Normals layer element, or NULL to remove the Normals definition.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Normals defined.

void SetBinormals ( KFbxLayerElementBinormal pBinormals  ) 

Sets this layer's Binormals description.

Parameters:
pBinormals  A pointer to the Binormals layer element, or NULL to remove the Binormals definition.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Binormals defined.

void SetTangents ( KFbxLayerElementTangent pTangents  ) 

Sets this layer's Tangents description.

Parameters:
pTangents  A pointer to the Tangents layer element, or NULL to remove the Tangents definition.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Tangents defined.

void SetMaterials ( KFbxLayerElementMaterial pMaterials  ) 

Sets this layer's Materials description.

Parameters:
pMaterials  A pointer to the Materials layer element, or NULL to remove the Material definition.

void SetPolygonGroups ( KFbxLayerElementPolygonGroup pPolygonGroups  ) 

Sets this layer's Polygon Groups description.

Parameters:
pPolygonGroups  A pointer to the Polygon Groups layer element, or NULL to remove the Polygon Group definition.

void SetUVs ( KFbxLayerElementUV pUVs,
KFbxLayerElement::ELayerElementType  pTypeIdentifier = KFbxLayerElement::eDIFFUSE_TEXTURES  
)

Sets this layer's UVs description.

Parameters:
pUVs  A pointer to the UVs layer element, or NULL to remove the UV definition.
pTypeIdentifier  Layer element type, should be texture type.
Remarks:
KFbxNurb or KFbxPatch geometry should not have UVs defined. The NURBS/Patch parameterization is used as UV parameters to map a texture.

void SetVertexColors ( KFbxLayerElementVertexColor pVertexColors  ) 

Sets this layer's Vertex Colors description.

Parameters:
pVertexColors  A pointer to the Vertex Colors layer element, or NULL to remove the Vertex Color definition.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Vertex Colors defined, since no vertex exists.

void SetSmoothing ( KFbxLayerElementSmoothing pSmoothing  ) 

Sets this layer's Smoothing description.

Parameters:
pSmoothing  A pointer to the Smoothing layer element, or NULL to remove the Smoothing definition.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Smoothing defined.

void SetVertexCrease ( KFbxLayerElementCrease pCrease  ) 

Sets this layer's Vertex Crease description.

Parameters:
pCrease  A pointer to the Vertex Crease layer element, or NULL to remove the Crease definition.
Remarks:
Crease should only be defined when the geometry is KFbxSubdiv.

void SetEdgeCrease ( KFbxLayerElementCrease pCrease  ) 

Sets this layer's Edge Crease description.

Parameters:
pCrease  A pointer to the Edge Crease layer element, or NULL to remove the Crease definition.
Remarks:
Crease should only be defined when the geometry is KFbxSubdiv.

void SetHole ( KFbxLayerElementHole pHole  ) 

Sets this layer's Hole description.

Parameters:
pHole  A pointer to the Hole layer element, or NULL to remove the Hole definition.
Remarks:
Hole should only be defined when the geometry is KFbxMesh.

void SetUserData ( KFbxLayerElementUserData pUserData  ) 

Sets this layer's User Data.

Parameters:
pUserData  A pointer to the User Data layer element, or NULL to remove the User Data.

void SetVisibility ( KFbxLayerElementVisibility pVisibility  ) 

Sets this layer's the visibility.

Parameters:
pVisibility  A pointer to the visibility layer element, or NULL to remove the visibility.

KFbxLayerElement* CreateLayerElementOfType ( KFbxLayerElement::ELayerElementType  pType,
bool  pIsUV = false  
)

Creates the specified type of layer element description for this layer.

Parameters:
pType  The required Layer element type.
pIsUV  When true, requests the UV LayerElement that corresponds with the specified Layer Element type (only applies to TEXTURE type layer elements).
Returns:
A pointer to the newly created layer element, or NULL if the layer element has not been created for this layer.

void Clone ( KFbxLayer const &  pSrcLayer,
KFbxSdkManager pSdkManager  
)

Clone function.

Parameters:
pSrcLayer  The source layer to be cloned.
pSdkManager 
KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer
KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer